import re

s = '90BC3721D86'
#自定义实现替换逻辑
def convert(value):
    matched = value.group()
    if int(matched) >= 6:
        return '9'
    else:
        return '0'
r = re.sub('\d',convert,s)
print(r)

w = re.findall('\d+',s)
print(w)

x = re.match('\d',s)
print(x.span())

q = re.search('\d',s)
print(q.group())